package org.eclipse.moquette.parser.netty;

import io.netty.buffer.ByteBuf;
import io.netty.util.AttributeMap;
import org.eclipse.moquette.proto.messages.PingRespMessage;

import java.util.List;

/**
 * Created by alex on 15-5-25.
 */
public class PingRespDecoder extends DemuxDecoder {

    @Override
    void decode(AttributeMap ctx, ByteBuf in, List<Object> out) throws Exception {

        in.resetReaderIndex();
        PingRespMessage message = new PingRespMessage();
        if (!decodeCommonHeader(message, 0x00, in)){
            in.resetReaderIndex();
            return;
        }
        out.add(message);
    }
}
